import React from 'react';
import { useNavigate } from 'react-router-dom';

function Chuan() {
    const navigate = useNavigate();

  const goToAboutWithParams = () => {
    navigate('/chuan2?name=JohnDoe');
  };

  return (
    <div>
       <div>
      <h1>传参</h1>
      <button onClick={goToAboutWithParams}>跳转页面</button>
    </div>
    </div>
  )
}

export default Chuan
